34

Beginner’s Guide to Code Algorithms

34

2.7  CONCLUSION

Why Tic Tac Toe?

This is a program that has many qualities I wanted to highlight.

• The concept of an algorithm

• The iteration concept

• The selection concept

• The gamification of a process

• The introduction to various components of a user interface

Just to recap the algorithms we used in this game:

• Transferring the row and column to a single number

• Identifying if a “winning” row, column, or diagonal is formed

• Identifying the next best move for the computer

You also learnt the following concepts in this chapter:

• Using a function

• Declaration using PUBLIC

• How to build a Form

• Debugging

• If statements

• For statements

There is a glossary at the end of the book with these terms explained. Remember, you

always have an online reference for the VBA language that you can consult—​it is free

and the link is provided in the “References” chapter at the end.

If you have built this already following the instructions I have described, you

might like to extend your learning further.

Here is a problem for you. How can you extend this game to a 16 square (4 by

4) matrix?